<template>
  <div class="form__box">
    <div class="item__row">
      <span class="item__name">累计合买计划数:</span>
      <Input v-model="accumulateProjectNum" placeholder="请输入数字" clearable style="width: 200px"/>
    </div>
    <div class="item__row">
      <span class="item__name">累计投资人数:</span>
      <Input v-model="accumulateInvestNum" placeholder="请输入数字" clearable style="width: 200px"/>
    </div>
    <div class="item__row">
      <span class="item__name">风险金余额:</span>
      <Input v-model="riskGoldBalance" placeholder="请输入数字" clearable style="width: 200px"/>
    </div>
    <div class="btn__default btn__confirm" @click="confirm">提交</div>
  </div>
</template>
<script>
import Api from '@/api';

export default {
  data() {
    return {
      accumulateProjectNum: '',
      accumulateInvestNum: '',
      riskGoldBalance: '',
    }
  },
  methods: {
    confirm() {
      const { accumulateProjectNum, accumulateInvestNum, riskGoldBalance} = this;
      Api.updateStatis({
        accumulateProjectNum,
        accumulateInvestNum,
        riskGoldBalance
      }).then(res => {
        this.$Message.success({content: '提交成功'});
      }).catch(err => {
        this.$Message.error({content: '提交失败'});
      });
    }
  }
}
</script>
<style scoped>
.item__name {
  display: inline-block;
  width: 120px;
  text-align: right;
  margin-right: 20px
}
.item__row {
  margin-bottom: 20px;
}
.btn__confirm {
  margin-left: 160px
}
</style>
